﻿@model PagedList.IPagedList<UscSunShine.Models.Request>
@using PagedList.Mvc;
<link href="~/Content/PagedList.css" rel="stylesheet" type="text/css" />

@{
    ViewBag.Title = "服务信息";
}

<h2>服务信息</h2>
<br />

@*<p>
        @Html.ActionLink("提交", "Create", null, htmlAttributes: new { @class = "btn btn-primary" })

        @Html.ActionLink("审核回复", "AuditIndex", null, htmlAttributes: new { @class="btn btn-warning"})
    </p>*@
@using (Html.BeginForm("Index", "RequestManage", FormMethod.Get))
{
    <p>
        受理单位：@Html.DropDownList("departmentID", "全部")
        类别：@Html.DropDownList("requestCategory", "全部")
        主题: @Html.TextBox("titleSearchString", ViewBag.currentTitle as string)
        受理单号：@Html.TextBox("acceptNumberSearchString", ViewBag.currentNumber as string)
        <input type="submit" value="查询" class="btn btn-default btn-sm" />
    </p>

}
<table class="table table-hover table-striped">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.FirstOrDefault().DepartmentID)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.FirstOrDefault().RequestCategory)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.FirstOrDefault().Title)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.FirstOrDefault().AcceptNumber)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.FirstOrDefault().ProcessStatus)
        </th>
        <th></th>
    </tr>

    @foreach (var item in Model)
    {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.Department.Name)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.RequestCategory)
            </td>
            <td>
                @Html.ActionLink(item.Title, "Details", new { id = item.ID })
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.AcceptNumber)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.ProcessStatus)
            </td>
            <td>
                @Html.ActionLink("回复", "Edit", new { id = item.ID }, htmlAttributes: new { @class = "btn btn-primary btn-sm" })
                @Html.ActionLink("查看", "Details", new { id = item.ID }, htmlAttributes: new { @class = "btn btn-info btn-sm" })
            </td>
        </tr>
    }

</table>
<br />
第 @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber) 页，共 @Model.PageCount 页
@Html.PagedListPager(Model, page => Url.Action("Index", new
{
    page,
    currentDepartmentID = ViewBag.currentDepartmentID,
    currentCategory = ViewBag.currentCategory,
    currentTitle = ViewBag.currentTitle,
    currentNumber = ViewBag.currentNumber
}))